| Conditions | 3 |
| Paths | 1 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | /** |
||
| 34 | let parse = (body) => { |
||
| 35 | try { |
||
| 36 | let { |
||
| 37 | "output": output, |
||
| 38 | "comparison": { |
||
| 39 | "success": success |
||
| 40 | } |
||
| 41 | } = body; |
||
| 42 | if (success) { |
||
|
|
|||
| 43 | return Promise.resolve(output); |
||
| 44 | } else { |
||
| 45 | throw `Success property must be true`; |
||
| 46 | } |
||
| 47 | } catch(error) { |
||
| 48 | let message = `The body is not of response type '${name}'\n`; |
||
| 49 | message += error.message; |
||
| 50 | throw new Error(message); |
||
| 51 | } |
||
| 52 | }; |
||
| 53 | |||
| 58 |